<template>
    <div>
        <div v-for="i in subList" :key="i.id" @click="$router.push({path:'/detail',query:{id:i.id}})">
            <div>{{i.date}}</div>
            <div>{{i.title}}</div>
            <div>{{i.count}}</div>
            <div>{{i.pic}}</div>
        </div>
    </div>
</template>
<script>
import {mapState, mapMutations} from 'vuex'
export default {
    computed:{
        ...mapState(['subList'])
    },
    methods:{
        ...mapMutations(['getSubList'])
    },
    mounted(){
        this.getSubList({id:this.$route.params.id})
    }
}
</script>